home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
ndr3.exe
/
VERLITE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-04
|
2KB
|
81 lines
/*
VERLITE.C shows how to obtain the version numbers
from NetWare Lite.
Author: Tim Farley
Copyright 1993, Tim Farley, All Rights Reserved
*/
#include <stdlib.h> /* for NULL */
#include <dos.h> /* for _dos_getvect() or getvect() */
#ifdef __TURBOC__
#define ASM asm
#define GETVECT getvect
#else
/* assume Microsoft C if not Turbo/Borland C */
#define ASM _asm
#define GETVECT _dos_getvect
#endif
/*
GetLiteVersion is a subroutine that calls the CLIENT or
SERVER detect.
Input: funCode = DETECT_CLIENT to detect CLIENT.EXE
DETECT_SERVER to detect SERVER.EXE
*/
#define DETECT_CLIENT 0xD800
#define DETECT_SERVER 0xD880
static int GetLiteVersion( int funCode )
{
unsigned long int2Fvector;
int returnCode;
int liteVer;
/*
Make sure INT 2Fh is initialized. This is only
technically necessary to support DOS 2.x.
*/
int2Fvector = (unsigned long)GETVECT( 0x2F );
if ( 0UL == int2Fvector ) /* No INT 2Fh handler? */
return ( 0 ); /* then no IPX! */
ASM {
push di /* trashed by call */
mov ax,funCode /* CLIENT or SERVER detect */
int 2fh
xor ah,ah
mov returnCode,ax /* AL = FF if present */
mov liteVer,dx /* DX = version */
pop di /* restore trashed reg */
}
if ( 0xFF != returnCode ) /* If return code failed */
return ( 0 ); /* return version 0.00 */
return ( liteVer );
} /* GetLiteVersion() */
/*
GetLiteClientVersion
*/
int GetLiteClientVersion( void )
{
return ( GetLiteVersion( DETECT_CLIENT ) );
} /* GetLiteClientVersion() */
/*
GetLiteServerVersion
*/
int GetLiteServerVersion( void )
{
return ( GetLiteVersion( DETECT_SERVER ) );
} /* GetLiteServerVersion() */
/* eof: VERLITE.C */